{# Modal for IDP creation/edition #}
<div class='modal fade' id='idpModal' tabindex='-1' role='dialog' aria-labelledby='idpModalLabel'>
  <div class='modal-dialog modal-xl' role='document'>
    <div class='modal-content'>
      <div class='modal-header'>
        <h5 class='modal-title' id='idpModalLabel'>{{ 'Edit IDP'|trans }}</h5>
        <button type='button' class='close' data-dismiss='modal' aria-label='{{ 'Close'|trans }}'>
          <span aria-hidden='true'>&times;</span>
        </button>
      </div>
      <form id='idpForm'>
        <div class='modal-body' data-wait='{{ 'Please wait…'|trans }}'>
          <div class='d-flex justify-content-between'>
            <label for='idpModal_name' class='col-form-label'>{{ 'Friendly name'|trans }}</label>
            <input class='form-control col-md-4' type='text' placeholder='Acme Looniversity' id='idpModal_name' name='name' required />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_entityid' class='col-form-label'>EntityId</label>
            <input class='form-control col-md-4' type='url' placeholder='https://idp.example.com/saml' id='idpModal_entityid' name='entityid' required />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_sso_url' class='col-form-label'>Single Sign-On URL</label>
            <input class='form-control col-md-4' type='url' placeholder='https://idp.example.com/saml/sso' id='idpModal_sso_url' name='sso_url' required />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_sso_binding' class='col-form-label'>Single Sign-On Binding</label>
            <select class='form-control col-md-4' id='idpModal_sso_binding' name='sso_binding'>
              <option value='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'>Redirect</option>
              <option value='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'>POST</option>
              <option value='urn:mace:shibboleth:1.0:profiles:AuthnRequest'>Shibboleth AuthnRequest</option>
            </select>
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_slo_url' class='col-form-label'>Single Log Out URL</label>
            <input class='form-control col-md-4' type='url' placeholder='https://idp.example.com/saml/slo' id='idpModal_slo_url' name='slo_url' />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_slo_binding' class='col-form-label'>Single Log Out Binding (only Redirect is supported)</label>
            <select class='form-control col-md-4' id='idpModal_slo_binding' name='slo_binding'>
              <option value='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'>Redirect</option>
              <option value='urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'>POST</option>
            </select>
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <div>
              <label for='idpModal_x509_idp' class='col-form-label'>x509 Certificate</label>
              <input type='file' data-action='load-file-on-change' data-ignore='1' data-target='idpModal_x509_idp' class='form-control' aria-label='File upload: x509 Certificate in PEM format' />
            </div>
              <textarea class='form-control col-md-4' id='idpModal_x509_idp' placeholder='-----BEGIN CERTIFICATE-----MIIELDCC...' name='x509' required></textarea>
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <div>
              <label for='idpModal_x509_new_idp' class='col-form-label'>x509 Certificate (additional for rollover)</label>
              <input type='file' data-action='load-file-on-change' data-ignore='1' data-target='idpModal_x509_new_idp' class='form-control' aria-label='File upload: Rollover x509 Certificate in PEM format' />
            </div>
            <textarea class='form-control col-md-4' id='idpModal_x509_new_idp' name='x509_new' required></textarea>
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_email_attr' class='col-form-label'>What attribute to look for the email</label>
            <input class='form-control col-md-4' type='text' placeholder='mail' data-allow-empty='1' value='urn:oid:0.9.2342.19200300.100.1.3' id='idpModal_email_attr' name='email_attr' />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_fname_attr' class='col-form-label'>What attribute to look for the firstname</label>
            <input class='form-control col-md-4' type='text' placeholder='givenName' data-allow-empty='1' value='urn:oid:2.5.4.42' id='idpModal_fname_attr' name='fname_attr' />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_lname_attr' class='col-form-label'>What attribute to look for the lastname</label>
            <input class='form-control col-md-4' type='text' placeholder='sn' data-allow-empty='1' value='urn:oid:2.5.4.4' id='idpModal_lname_attr' name='lname_attr' />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_team_attr' class='col-form-label'>What attribute to look for the team name (optional)</label>
            <input class='form-control col-md-4' type='text' data-allow-empty='1' id='idpModal_team_attr' name='team_attr' />
          </div>
          <hr>

          <div class='d-flex justify-content-between'>
            <label for='idpModal_orgid_attr' class='col-form-label'>What attribute to look for the internal id (optional)</label>
            <input class='form-control col-md-4' type='text' data-allow-empty='1' id='idpModal_orgid_attr' name='orgid_attr' />
          </div>
        </div>
        <div class='modal-footer'>
          <button type='button' class='btn btn-ghost' data-dismiss='modal'>{{ 'Cancel'|trans }}</button>
          <button type='submit' data-action='save-idp' id='idpModalSaveButton' data-dismiss='modal' class='btn btn-primary'>{{ 'Save'|trans }}</button>
        </div>
      </form>
    </div>
  </div>
</div>
